1. Field of the Invention
The invention relates to facial recognition and tracking, and more particularly, to an orientation correction method for scan lines which are used to perform face detection on an image, such that tracking/recognition can be performed continuously regardless of a degree of orientation of a device used to capture the image, and a device thereof.
2. Description of the Prior Art
The recent developments in 3G and 4G technology have given rise to a huge increase in the number of people who own personal electronic devices. Smart phones and tablet devices are now ubiquitous in everyday life. Manufacturers are constantly seeking ways to differentiate their product from the many others available on the market. One way is to integrate various existing applications of the personal electronic device for increasing the ease of use and number of functions available to a user.
Even the most basic smart phone or tablet comes equipped with a dedicated camera which can capture both images and live video. Facial recognition technology can be used on a captured image to perform other applications: for example, a personalized unlocking procedure, whereby an image is captured by the camera and scanning lines within a frame defined on the image are used to determine the user's identity. The camera can also be used in conjunction with video chat applications such as Skype.
When a smart phone is first turned on, the phone is typically held in a ‘portrait’ position. An image of a user captured by the dedicated camera will therefore also be displayed on the screen in a portrait position. As the phone is rotated over 90 degrees to a ‘landscape’ position, sensors in the phone will determine a degree of orientation. Beyond a certain threshold (typically 45 degrees), the displayed image will be flipped. When performing face detection as pre-processing of facial tracking/recognition, however, the frame used to scan an image and the corresponding scan lines will not change with the orientation of the phone. Please refer to FIG. 1 which illustrates three degrees of orientation of an electronic device 10. In the following, the electronic device 10 is a phone 10, but this is merely for exemplary purposes.
As illustrated in the diagrams, the phone 10 is equipped with a camera 12 and a display screen 16. A frame 14 is defined on the display screen 16 and used for scanning an image, and the scan lines run in a horizontal direction across the display screen 16 from left to right. In FIG. 1A, the phone 10 is held in the standard ‘portrait’ position, and the frame 14 used for scanning a face is also in a portrait position. In FIG. 1B, the phone 10 is rotated to 45 degrees. As this degree of orientation is at the threshold at which the displayed image will flip, the image is displayed in a landscape position but the frame 14 and scan lines used for performing face detection are at a 45 degree angle with respect to the face. The scanning lines will therefore not detect the user's face image, as they are no longer scanning the image horizontally from left to right. In FIG. 1C, the phone 10 has been rotated through 90 degrees, and the frame 14 now has scan lines which are vertical rather than horizontal. In both FIG. 1B and FIG. 1C, the face detection will fail, which means the method cannot proceed to the facial recognition step. Standard smart phones/tablets are therefore limited to holding the device in one position for performing facial recognition.
As detailed above, the camera 12 incorporated into a standard smart phone 10 can also be used to perform facial tracking; for example, when using Skype. For this application, the face detection first has to be performed. Please refer to FIG. 2 which is a flowchart showing a method of performing complete functions of a facial tracking/recognition system according to the prior art. The steps are as follows:
Step 200: Start.
Step 202: Face detection.
Step 204: Is face detection ok? If yes, go to Step 206; if no, go to Step 210.
Step 206: Perform face tracking.
Step 208: Is face tracking ok? If yes, return to Step 206; if no, go back to Step 202.
Step 210: Perform error handling; go to Step 202.
As shown in Step 204, once face detection is confirmed then tracking can be performed. If, however, the image is lost during tracking, face detection will need to be performed again. As face detection can only work when the phone is held in a portrait position, the phone must be rotated back to the original portrait position (error handling). This can be quite inconvenient for a user.